package top.fengyulou.code.controller.back.user;

import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import top.fengyulou.code.entity.UserForm;
import top.fengyulou.code.service.UserService;
import top.fengyulou.common.Jr;
import top.fengyulou.common.UserUtils;
import top.fengyulou.common.WebUtils;
import top.fengyulou.config.SysConfig;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;

/**
 * 用户管理
 */
@Controller
@RequestMapping("/b/user")
public class BackUserController {
    @Resource
    private SysConfig sysConfig;

    /**
     * 用户退出
     *
     * @param request
     * @return
     */
    @GetMapping("/exit")
    public String exit(HttpServletRequest request) {
        //用户退出
        UserUtils.exit(request);
        return WebUtils.redirect(sysConfig.getDomainName(), "/");
    }

}
